package workspace;

import java.util.Scanner;

/**
 * @Description
 * @Author yangshunjie
 * @Date 2021/10/24
 */
public class test7 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int T =scanner.nextInt();
        for (int g = 0; g < T; g++) {
            int max = -1;
            int n = scanner.nextInt();
            int m = scanner.nextInt();
            int [][]in = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    in[i][j] = scanner.nextInt();
                }
            }

            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    int temp = -1;
                    if(in[i][j]==-1){
                        continue;
                    }
                    temp = in[i][j];
                    for (int k = 1; i+k<m&&j+k<n; k++) {
                        int k1 = 1;
                        int k2 =1;
                        if(in[i+k1][j+1]==-1){
                        }
                    }
                }
            }
        }
    }
}
